package hy.config;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@ControllerAdvice
public class AuthException {
    @ExceptionHandler(value = Exception.class)//处理访问方法时权限不足问题
    public void AuthcErrorHandler(HttpServletResponse res, Exception e) throws IOException {
        res.sendRedirect("/showError");
    }
}